package Pokero;



public abstract class Player {
        
        
	public String imie;
        
       public Card[] Hand;
       
       public int money;
       
       public int zwyciestwa;
       
       //konstruktor gracza
       
       public Player(String imie, int money)
       {
           this.imie = imie;
           Hand = new Card[5];
           //rozdaj();
           this.money = money;
       }
       
       public String toString()
       {
           String tmp = imie;
           for(int i = 0; i < 5; i++)
           {
                   tmp = tmp + Hand[i];
           }
           return tmp;
       }
       
       public String showCards(int i) {
           return Hand[i].rank + " " + Hand[i].suit;
       }
       
       public int showMoney() {
           return money;
       }
       
       public Card wymien() {
           Card card = Deck.wybierz();
           return card;
       }
       
       public final int pobierzWpisowe() {
    	   final int wpisowe = 5;
           if (wpisowe > this.money) {
               int tmp = this.money;
               this.money = 0;
               return tmp;
           } else {
               this.money = this.money - wpisowe;
               return wpisowe;
           }
       }
        public void rozdaj()
        {
                for(int i = 0; i < 5; i++)
                {
                        Hand[i] = Deck.wybierz();
                        //String previous  = PokerFrame.text.getText();
                        //PokerFrame.text.setText(previous + "\n" + Hand[i].rank + " " + Hand[i].suit);
                }
        }

        
        
}